POV-Ray : Newsgroups : povray.general : Maybe someone can help me ... : Re: Maybe someone can help me ... Server Time
29 Jul 2024 04:29:41 EDT (-0400)
  Re: Maybe someone can help me ...  
From: Brendt Hess
Date: 11 Jan 2000 17:42:35
Message: <387bb1db@news.povray.org>
Paul Vanukoff wrote in message <386a1908@news.povray.org>...
>
>I'm trying to create a ying/yang sort of image. Here is some source that
>defines the objects. On paper it seems like it would work, but when
>rendered, there is a nice gap between the two halves. I have messed around
>with different formulae, but can't get it right. Can anyone grok the
formula
>for this?  :)


As I always say, when in doubt - cheat!

This code generates a correct monad (technical term for a yin-yang) using
only primitives and CSG.

Hope it helps.

// A monad (yin/yang without the interior circles) from primitives only.
//
//  Brendt Hess
//

#declare Cyl1=cylinder {<0,0,0>,<0,.1,0>,1}        // size of final monad
#declare Cyl2=cylinder { <0,0,0>,<0,.1,0>,.5}      // 1/2 size of final
monad.

#declare CylPart=difference { object { Cyl1 }
                              object { Cyl2 scale <1,1.01,1> translate
<0,0,.5>}
                              object { Cyl2 scale <1,1.01,1> translate
<0,0,-.5>}
                              box {<-1.01,-.01,-1.01>,<0,.101,1.01>}
                            }

// put the pieces together

#declare YinYang=union { object { CylPart pigment {rgb 1}}
                         object { CylPart rotate y*180 pigment { rgb 0 }}
                         object { Cyl2 translate <0,0,.5> pigment {rgb 1}}
                         object { Cyl2 translate <0,0,-.5> pigment {rgb 0}}
                       }

// now, let's look at it

  camera

    location <0,4,0>
    look_at <0,0,0>
    angle 45
  }

  light_source { <0,10,0> rgb 1}

YinYang
plane {y,-2 pigment {rgb <.5,.5,0>}}
// end of code


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.